//
//  ActivityIndicator_view.m
//  iStock Global
//
//  Created by 英傑 翁 on 11/12/6.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "ActivityIndicator_view.h"
#import <QuartzCore/QuartzCore.h>

@implementation ActivityIndicator_view
@synthesize label_state;
@synthesize progbar;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //1.文字敘述
        label_state = [[UILabel alloc]
                       initWithFrame:CGRectMake(60.0f,30.0f,100.0f,40.0f)];
        label_state.font = [UIFont systemFontOfSize:16.0f];
        label_state.textColor = [UIColor whiteColor];
        label_state.backgroundColor = [UIColor clearColor];
        label_state.textAlignment = UITextAlignmentLeft;
        
        [self addSubview:label_state];
        [label_state release];
        //2.
        
        ActivityIndicator=[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0.0f,20.0f,60.0f,60.0f)];
        ActivityIndicator.activityIndicatorViewStyle=UIActivityIndicatorViewStyleWhiteLarge;
        [ActivityIndicator startAnimating];
        
        [self addSubview:ActivityIndicator];        
        [ActivityIndicator release];
        //3 進度指示器
         progbar = [[UIProgressView alloc] initWithFrame:CGRectMake(20.0f, 80.0f, 120.0f, 30.0f)];
        [progbar setProgressViewStyle: UIProgressViewStyleDefault];
		[self addSubview:progbar];
		[progbar release];  
        
        
        //uiview 設定
        self.frame= CGRectMake(80.0f,130.0f,160.0f,100.0f);
        self.backgroundColor=[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5]; 
         //注意如果要使用圓角就是要新增 #import <QuartzCore/QuartzCore.h>  
        [self.layer setCornerRadius:15.0f];
        [self.layer setMasksToBounds:YES];        
        
    
    }
    return self;
}

 
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
 

@end
